package ai.xiaodao.tool;

import com.google.protobuf.Descriptors;
import org.springframework.mail.javamail.InternetAddressEditor;

/**
 * validator  of the input the config
 */

public class Validator {
    public static boolean validEmail(String email) {
        String regex = "^[\\w-_\\.+]*[\\w-_\\.]\\@([\\w]+\\.)+[\\w]+[\\w]$";
        return email.matches(regex);
    }
    public static boolean validPort(String port) {
        String regex = "^[\\w-_\\.+]*[\\w-_\\.]\\@([\\w]+\\.)+[\\w]+[\\w]$";
        return port.matches(regex);
    }
}
